<template>
	<view>
		<myhead left="1" txt="我的资产"></myhead>
		<view class="list">
			<view>
				<view>可用</view>
				<view>{{list?list.usdtAmount:'0.00000000'}}</view>
			</view>
			<view>
				<view>冻结</view>
				<view>{{list?list.frozenAmount:'0.00000000'}}</view>
			</view>
			<view>
				<view>拆合（USDT）</view>
				<view>0.00000000</view>
			</view>
		</view>
		<view class="mxLi" v-for="(item,index) in mxList" :key="index">
			<view>
				<view>{{item.type==0?'充值':'提币'}}</view>
				<view class="mxLiColor">{{item.status==0?'申请中':'已审核'}}</view>
			</view>
			<view>
				<view>{{item.type==0?'充值数量':'提币数量'}}：<span>{{item.useableAmount}}</span></view>
				<view>手续费：<span class="mxLiColor">{{item.profitAmount}}</span></view>
				<view><span>{{item.createdTime}}</span></view>
			</view>
			<view>
				<view>USDT地址：<span>{{item.address}}</span></view>
			</view>
		</view>
	</view>
</template>

<script>
	const http = require('../../utils/http.js');
	export default {
		data() {
			return {
				list:null,
				mxList:null
			}
		},
		onShow() {
			uni.showLoading({
			    title: '加载中'
			});
			http.get('/api/user/accountInfo').then(res => {
				if (res.code == 200 && res.result) {
					this.list=res.result
					http.get('/api/user/getMyAccountTrade').then(res => {
						if (res.code == 200 && res.result) {
							this.mxList=res.result
						}
						if(!res.result.length){
							uni.showToast({
							  title: '暂无数据',
							  icon: 'none'
							});
						}
						uni.hideLoading();
					})
				}
				uni.hideLoading();
			})
		},
		methods: {
			
		}
	}
</script>

<style>
	.list{
		padding: 4vw;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		font-size: 3.8vw;
		border-bottom: 2vw solid #f2f2f2;
	}
	.list>view>view:nth-child(1){
		margin-bottom: 2vw;
		color: #999999;
	}
	.mxLi{
		padding: 2vw;
		display: flex;
		flex-direction: column;
		font-size: 3.2vw;
		color: #333333;
		border-bottom: 1px solid #f2f2f2;
	}
	.mxLi>view:nth-child(1)>view:nth-child(1){
		border-left: 1vw solid #007AFF;
		padding-left: 1vw;
	}
	.mxLi>view{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 1vw 0;
		word-break:break-all;
	}
	.mxLi span{
		color: #999999;
	}
	.mxLiColor{
		color: #DD524D !important;
	}
</style>
